package com.example.demo.design.template_method.salary_deliver;

import lombok.Getter;
import lombok.Setter;

/**
 * @Author: liull
 * @Description:
 * @Date: Created in 23:23 2020/11/11
 * @Modified By: liull 编写工资系统，实现不同类型员工（多态）的按月发放工资，如果当月出现某个Employee生日， 则发发送生日福利100 rmb (1)定义一个Employee类,该类包含:
 *           privat成员变iname,number,birthday,其中birthday为MyDate类的对象:abstract方法earnings(); ， toString(方法输出对象的name .number和birthday. (2) MyDate类包含:
 *           private成员变量year,month,day : toDateString(方法返回日期对应的字符串: xxxx年xx月xx日 (3)定义SalariedEmployee类继承Employee类，实现按月计算工资的员工处 理。该类包括: private成
 *           员变最monthlySalary: 实现父类的抽象方法earnings(,.该方法返回monthlySalary值: toString(方法输 出员工类型信息及员工的name, numberbirthday
 */
@Getter
@Setter
public abstract class Employee {
    private String name;

    private int number;

    private MyDate birthday;

    public Employee(String name, int number, MyDate birthday) {
        this.name = name;
        this.number = number;
        this.birthday = birthday;
    }

    public Employee() {
    }

    public abstract double earnings();

    @Override
    public String toString() {
        return "Employee{" +
                "name='" + name + '\'' +
                ", number=" + number +
                ", birthday=" + birthday.toDateString() +
                '}';
    }

}
